﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using TBlog.Web.Common.PageHelper;
using TBlog.Web.Models;
using TBlog.Web.Repository;
using TBlog.Web.ViewModel;

namespace TBlog.Web.Service
{
    public class ArticleService : BaseService<Article>, IArticleService
    {
        IRepository<Article> _reposiotry;
        public ArticleService(IRepository<Article> reposiotry)
            : base(reposiotry)
        {
            _reposiotry = reposiotry;
        }

        public PagedList<Article> GetArticleList(Expression<Func<Article, bool>> predicate, PageListRequest pr)
        {
            return _reposiotry.GetAll().ToPagedList(predicate, pr);
        }
    }
}